<template>
	<view class="zai-box">
		<image src="/static/register.png" mode='aspectFit' class="zai-logo"></image>
		<view class="zai-title">宠物领养</view>
		<view class="zai-form">
			<input class="zai-input" v-model="from.userName"  placeholder="请输入用户名" />
			<input class="zai-input" v-model="from.password" password placeholder="请输入密码"/>
			<!-- <input class="zai-input" placeholder-class password placeholder="请再输入一次密码"/> -->
			<button class="zai-btn" @click="zhuce()">立即注册</button>
			<navigator url="/pages/login/login" open-type='navigateBack' hover-class="none" class="zai-label">已有账号，点此去登录.</navigator>
		</view>
	</view>
</template>

<script>
	import { appAdd } from "@/api/list.js"
	export default {
		data() {
			return {
				from:{
				},
				range: [
						
						{ value: 1, text: "火葬" },
						{ value: 2, text: "水葬" },
					  ],
				range1: [
						{ value: 0, text: "男生" },
						{ value: 1, text: "女生" },
					  ],
				range2: [
						{ value: 0, text: "已绝育" },
						{ value: 1, text: "已驱虫" },
						{ value: 2, text: "已免疫" },
					  ],
				range3: [
						{ value: 0, text: "家养" },
						{ value: 1, text: "个人救助" },
						{ value: 2, text: "流浪基地" },
					  ],
		  }
		},
		methods: {
			zhuce(){
				appAdd(this.from).then(result => {
					if (result.data.code == 200) {
						uni.switchTab({
							url: '/pages/login/login'
						})
						
					} else {
						uni.showToast({
							title: data.msg,
							icon: 'none',
							duration: 2000
						});
					}
				})
			},
		},
	}
</script>

<style>
	.zai-box{
		padding: 0 100upx;
		position: relative;
	}
	.zai-logo{
		width: 100%;
		width: 100%;
		height: 310upx;
	}
	.zai-title{
		position: absolute;
		top: 0;
		line-height: 360upx;
		font-size: 68upx;
		color: #fff;
		text-align: center;
		width: 100%;
		margin-left: -100upx;
	}
	.zai-form{
		margin-top: 300upx;
	}
	.zai-input{
		background: #e2f5fc;
		margin-top: 30upx;
		border-radius: 100upx;
		padding: 20upx 40upx;
		font-size: 36upx;
	}
	.input-placeholder, .zai-input{
		color: #94afce;
	}
	.zai-label{
		padding: 60upx 0;
		text-align: center;
		font-size: 30upx;
		color: #a7b6d0;
	}
	.zai-btn{
		background: #ff65a3;
		color: #fff;
		border: 0;
		border-radius: 100upx;
		font-size: 36upx;
		margin-top: 60upx;
	}
	.zai-btn:after{
		border: 0;
	}
	/*按钮点击效果*/
	.zai-btn.button-hover{
		transform: translate(1upx, 1upx);
	}
</style>
